import {CanActivate} from "@angular/router"
export class LoginGuard implements CanActivate {
    canActivate () {//进入路由时执行该方法
        let loggedIn: boolean = Math.random() < 0.5;
        if(!loggedIn) {
            console.log('用户未登录')
        }
        return loggedIn;
    }
}